package structures;
import pack.MyReader;

import java.util.Date;
import java.util.GregorianCalendar;

public class Datef extends TypeAbstract{

	public static int size = 4;
	
	public final String year; //BCDString (2)
	public final String month; //BCDString (1)
	public final String day; //BCDString(1)
	public final Date date;
	
	public Datef(MyReader reader)
	{
		year = reader.readBcd(2);
		month = reader.readBcd(1);
		day = reader.readBcd(1);
		GregorianCalendar cal = new GregorianCalendar(
		    Integer.parseInt(year), 
		    Integer.parseInt(month), 
		    Integer.parseInt(day)
		);
		date = cal.getTime();
	}
}
